SETUP INSTRUCTIONS
//////////////////////////////////

Please do not place the files in a directory called /discord or /steam. This will mess with the redirects.

IF YOU ARE USING PLESK, MAKE THE FOLLOWING CHANGE:

1. Click domains tab
2. Click domain or sub domain
3. Click hosting & dns
4. Click Apache & nginx settings
5. Paste the below in the "additional nginx directives" field then click apply

rewrite ^/([^\.]+)$ /$1.php break;

IF YOU ARE USING NGINX, PLEASE MAKE THE FOLLOWING CHANGES:

1. Open up main.conf.php and where you put https://link.icefuse.net/discord, change it to https://link.icefuse.net/discord.php.

2. Do the same thing with the URL in the developer portal.

3. Open complete.php, find <center><a href="unlink" style="font-size:30px;" class="unlinkButton"><i class="fa fa-unlink" aria-hidden="true"></i> Unlink</a></center> and replace with <center><a href="unlink.php" style="font-size:30px;" class="unlinkButton"><i class="fa fa-unlink" aria-hidden="true"></i> Unlink</a></center>

4. Open discord.php, find complete and replace with complete.php.

5. Open index.php, find header('location: discord'); replace with header('location: discord.php');

/////////////////////////////////


LINUX SPECIFIC
===================
You will need the php-xml and php-curl packages.
For example, on php 8 you will need to do:
sudo apt-get install php8.0-xml php8.0-curl


PRE PHASE - DISCORD DEV PORTAL
===================
1. Make a new Discord Bot in the Discord Developer Portal Website. Call it what you want, and make note of its name as you will need it for the bot section.

2. Move on to the OAuth2 section, under general and set the URL in "Redirects" to be https://yourdomain.com/discord.

3. Move down to URL Generators and select bot, and a new section named "Bot Permissions" should show up. Choose View Channels, Manage Server, Manage Roles. Then, click the save button and invite the bot to your guild. Upon inviting the bot, there should be a role name created that is exactly the name of your bot. Please move this role to the very top or else it won't properly give out your verified role.

4. Under the bot section, turn on the privileged intents.


PHASE 1 - DATABASE
===================
1. Make a new database, and import the SQL file from the folder titled 'SQL File'.

PHASE 2 - WEBSITE
===================
1. Upload all files that are in the website directory.

2. Modify main.conf.php
	2a. Change SQL_USER, SQL_PASS and DB_NAME to the correct details.
	2b. Redirect is the URL you set while making a bot on https://discord.com/developers/applications. This should be something like https://yourdomain.com/discord
	2c. Change VerifiedRoleID to the Role ID of your Verified role in Discord.
	2d. Webook is the URL where you will receive webhook notifications. Create a webhook for a channel of your choice in Discord.
	2e. Logo URL is the URL that will show up on the website.
	2f. SiteTitle is the title which will show up on the website.
	2g. Guild ID is your servers Guild ID.
	2h. Bot token, Client ID and Client Secret can all be found on the developer portal.

3. Modify steamauth/SteamConfig.php
	3a. Replace YOUR DOMAIN HERE with your linking website.
	3b. Replace STEAM API KEY with your Steam API Key.

4. Modify api.php
	1. Set your SECRET KEY in this file. It is "$$SECRET$$" by default.

5. Modify index.php
	1. Change all meta tags like "Your Server", "Your Logo", "Your Link".

6. Modify admin/steamauth/SteamConfig.php
	1. Replace LINKWEBSITEHERE with your link website domain.
	2. Replace APIKEYHERE with your Steam API Key.


PHASE 3 - PLUGIN
===================
1. Upload the plugin to your server

2. Modify the oxide/config/UniversalLink.json file

3. Fill in details. API URL will be https://yourdomain.com/api.php?action=steamChecks&id={id(s)}&secret=REPLACE-WITH-SECRET-FROM-API.PHP

4. If you are using role syncing, look at the JSON section beginning with OxideRoleName1, this will be the role you want to sync to Discord, and the numbers below it are the Discord Role ID.


PHASE 4 - BOT
===================
1. Upload SimpleLinkBot.js

2. Edit everything in config.json

3. Install npm packages (discord.js, node-fetch)


PHASE 5 - ADMIN PANEL
===================
1. Open 'admin' directory.

2. Edit site.conf.php and fill in all of your information.

3. Open your database, find your record by searching your Discord/Steam ID

4. Edit `staff_flag` and set it's value to 1. It should be 0.

5. Navigate to https://yourlinkingdomain.com/admin and view the login page.

FOR ANY QUESTIONS, COMMENTS, OR CONCERNS CONTACT ME ON DISCORD.
Ryz0r#0101

